package c.e.a.c.l;

import android.widget.BaseAdapter;
import com.google.android.material.datepicker.CalendarConstraints;
import com.google.android.material.datepicker.DateSelector;
import com.google.android.material.datepicker.Month;
import java.util.Calendar;

/* compiled from: MonthAdapter */
public class m extends BaseAdapter {
    public static final int e = t.d().getMaximum(4);
    public final Month a;
    public final DateSelector<?> b;
    public b c;
    public final CalendarConstraints d;

    public m(Month month, DateSelector<?> dateSelector, CalendarConstraints calendarConstraints) {
        this.a = month;
        this.b = dateSelector;
        this.d = calendarConstraints;
    }

    public int a() {
        return this.a.b();
    }

    /* renamed from: b */
    public Long getItem(int i) {
        if (i < this.a.b() || i > c()) {
            return null;
        }
        Month month = this.a;
        i = (i - month.b()) + 1;
        Calendar a = t.a(month.a);
        a.set(5, i);
        return Long.valueOf(a.getTimeInMillis());
    }

    public int c() {
        return (this.a.b() + this.a.f) - 1;
    }

    public int getCount() {
        return a() + this.a.f;
    }

    public long getItemId(int i) {
        return (long) (i / this.a.e);
    }

    /* JADX WARNING: Removed duplicated region for block: B:26:0x00f2  */
    public android.view.View getView(int r9, android.view.View r10, android.view.ViewGroup r11) {
        /*
        r8 = this;
        r0 = android.os.Build.VERSION.SDK_INT;
        r1 = r11.getContext();
        r2 = r8.c;
        if (r2 != 0) goto L_0x0011;
    L_0x000a:
        r2 = new c.e.a.c.l.b;
        r2.m1581init(r1);
        r8.c = r2;
    L_0x0011:
        r1 = r10;
        r1 = (android.widget.TextView) r1;
        r2 = 0;
        if (r10 != 0) goto L_0x0029;
    L_0x0017:
        r10 = r11.getContext();
        r10 = android.view.LayoutInflater.from(r10);
        r1 = 2131493009; // 0x7f0c0091 float:1.8609486E38 double:1.05309747E-314;
        r10 = r10.inflate(r1, r11, r2);
        r1 = r10;
        r1 = (android.widget.TextView) r1;
    L_0x0029:
        r10 = r8.a();
        r10 = r9 - r10;
        r11 = 1;
        if (r10 < 0) goto L_0x00e2;
    L_0x0032:
        r3 = r8.a;
        r4 = r3.f;
        if (r10 < r4) goto L_0x003a;
    L_0x0038:
        goto L_0x00e2;
    L_0x003a:
        r10 = r10 + r11;
        r1.setTag(r3);
        r3 = java.lang.String.valueOf(r10);
        r1.setText(r3);
        r3 = r8.a;
        r3 = r3.a;
        r3 = c.e.a.c.l.t.a(r3);
        r4 = 5;
        r3.set(r4, r10);
        r3 = r3.getTimeInMillis();
        r10 = r8.a;
        r10 = r10.d;
        r5 = new com.google.android.material.datepicker.Month;
        r6 = c.e.a.c.l.t.c();
        r5.m3522init(r6);
        r5 = r5.d;
        r6 = "UTC";
        r7 = 24;
        if (r10 != r5) goto L_0x00a3;
    L_0x006a:
        r10 = java.util.Locale.getDefault();
        if (r0 < r7) goto L_0x0089;
    L_0x0070:
        r0 = c.e.a.c.l.t.a;
        r0 = "MMMEd";
        r10 = android.icu.text.DateFormat.getInstanceForSkeleton(r0, r10);
        r0 = android.icu.util.TimeZone.getTimeZone(r6);
        r10.setTimeZone(r0);
        r0 = new java.util.Date;
        r0.<init>(r3);
        r10 = r10.format(r0);
        goto L_0x009f;
    L_0x0089:
        r0 = c.e.a.c.l.t.a;
        r10 = java.text.DateFormat.getDateInstance(r2, r10);
        r0 = c.e.a.c.l.t.b();
        r10.setTimeZone(r0);
        r0 = new java.util.Date;
        r0.<init>(r3);
        r10 = r10.format(r0);
    L_0x009f:
        r1.setContentDescription(r10);
        goto L_0x00db;
    L_0x00a3:
        r10 = java.util.Locale.getDefault();
        if (r0 < r7) goto L_0x00c2;
    L_0x00a9:
        r0 = c.e.a.c.l.t.a;
        r0 = "yMMMEd";
        r10 = android.icu.text.DateFormat.getInstanceForSkeleton(r0, r10);
        r0 = android.icu.util.TimeZone.getTimeZone(r6);
        r10.setTimeZone(r0);
        r0 = new java.util.Date;
        r0.<init>(r3);
        r10 = r10.format(r0);
        goto L_0x00d8;
    L_0x00c2:
        r0 = c.e.a.c.l.t.a;
        r10 = java.text.DateFormat.getDateInstance(r2, r10);
        r0 = c.e.a.c.l.t.b();
        r10.setTimeZone(r0);
        r0 = new java.util.Date;
        r0.<init>(r3);
        r10 = r10.format(r0);
    L_0x00d8:
        r1.setContentDescription(r10);
    L_0x00db:
        r1.setVisibility(r2);
        r1.setEnabled(r11);
        goto L_0x00ea;
    L_0x00e2:
        r10 = 8;
        r1.setVisibility(r10);
        r1.setEnabled(r2);
    L_0x00ea:
        r9 = r8.getItem(r9);
        if (r9 != 0) goto L_0x00f2;
    L_0x00f0:
        goto L_0x0175;
    L_0x00f2:
        r10 = r8.d;
        r10 = r10.d;
        r3 = r9.longValue();
        r10 = r10.k(r3);
        if (r10 == 0) goto L_0x016b;
    L_0x0100:
        r1.setEnabled(r11);
        r10 = r8.b;
        r10 = r10.o();
        r10 = r10.iterator();
    L_0x010d:
        r11 = r10.hasNext();
        if (r11 == 0) goto L_0x014b;
    L_0x0113:
        r11 = r10.next();
        r11 = (java.lang.Long) r11;
        r2 = r11.longValue();
        r4 = r9.longValue();
        r11 = c.e.a.c.l.t.d();
        r11.setTimeInMillis(r4);
        r11 = c.e.a.c.l.t.a(r11);
        r4 = r11.getTimeInMillis();
        r11 = c.e.a.c.l.t.d();
        r11.setTimeInMillis(r2);
        r11 = c.e.a.c.l.t.a(r11);
        r2 = r11.getTimeInMillis();
        r11 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1));
        if (r11 != 0) goto L_0x010d;
    L_0x0143:
        r9 = r8.c;
        r9 = r9.b;
        r9.b(r1);
        goto L_0x0175;
    L_0x014b:
        r10 = c.e.a.c.l.t.c();
        r10 = r10.getTimeInMillis();
        r2 = r9.longValue();
        r9 = (r10 > r2 ? 1 : (r10 == r2 ? 0 : -1));
        if (r9 != 0) goto L_0x0163;
    L_0x015b:
        r9 = r8.c;
        r9 = r9.c;
        r9.b(r1);
        goto L_0x0175;
    L_0x0163:
        r9 = r8.c;
        r9 = r9.a;
        r9.b(r1);
        goto L_0x0175;
    L_0x016b:
        r1.setEnabled(r2);
        r9 = r8.c;
        r9 = r9.g;
        r9.b(r1);
    L_0x0175:
        return r1;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.c.l.m.getView(int, android.view.View, android.view.ViewGroup):android.view.View");
    }

    public boolean hasStableIds() {
        return true;
    }
}
